
// Implementation of the point class

#include "point.h"

Point :: Point ()
{
	Point (0.0f, 0.0f, 0.0f);
}

Point :: Point (float _x, float _y, float _z)
{
	SetPoint (_x, _y, _z);
}

void Point :: SetPoint (float _x, float _y, float _z)
{
	x = _x;
	y = _y;
	z = _z;
}

Point Point :: operator + (Point& p)
{
	Point temp;
	temp.SetPoint (x+p.x, y+p.y, z+p.z);
	return temp;
}

Point Point :: operator - (Point& p)
{
	Point temp;
	temp.SetPoint (x-p.x, y-p.y, z-p.z);
	return temp;
}

Point Point :: operator * (float s)
{
	Point temp;
	temp.SetPoint (s*x, s*y, s*z);
	return temp;
}

Point Point :: operator / (float s)
{
	Point temp;
	temp.SetPoint ((float)(x/s), (float)(y/s), (float)(z/s));
	return temp;
}

Point Point :: operator = (Point& p)
{
	x = p.x;
	y = p.y;
	z = p.z;
	return *this;
}